part of '../../flutter_ns_ble.dart';

extension SyncData on Peripheral { 

 Stream<B1SyncDataEvent> get b1SyncDataState => _events
      .where((e) => e is B1SyncDataEvent && e.address == address)
      .cast<B1SyncDataEvent>()
      .shareValueSeeded(B1SyncDataEvent(address: address, state: B1SyncDataState.idle))
      ;

  Future<String?> startB1SyncData({bool? deleteBeforeWrite}) async {
    return await _methods.startB1SyncData(address, null, deleteBeforeWrite);
  }

  Future<bool> cancelB1SyncData() async {
    return await _methods.cancelB1SyncData(address);
  }
}